﻿@{
    string basePath = "http://" + Request.Url.Host + (Request.Url.Port == 80 ? "" : ":" + Request.Url.Port.ToString());
    string version = "201705201545";

    string easyuiTheme = "bootstrap";//指定如果用户未选择样式，那么初始化一个默认样式
    if (null != Request.Cookies["easyuiTheme"])
    {
        easyuiTheme = Request.Cookies["easyuiTheme"].ToString();
    }
    ViewBag.easyuiTheme = "default";
    ViewBag.ScriptVersion = version;
}
<script type="text/javascript">
    var sy = sy || {};
    sy.ContextPath = '@ViewBag.ContextPath';
    sy.basePath = '@basePath';
    sy.version = '@version';
    sy.pixel_0 = '@ViewBag.ContextPath/style/images/pixel_0.gif';//0像素的背景，一般用于占位
</script>


<!--引入my97日期时间控件 -->
<script type="text/javascript" src="@ViewBag.ContextPath/plugin/My97DatePicker/WdatePicker.js" charset="utf-8"></script>

<!-- 引入ueditor控件 -->
<script type="text/javascript" charset="utf-8">window.UEDITOR_HOME_URL = '@ViewBag.ContextPath/ueditor1_2_6_1-utf8-jsp/';</script>
<script src="@ViewBag.ContextPath/plugin/ueditor1_2_6_1-utf8-jsp/ueditor.config.js" type="text/javascript" charset="utf-8"></script>
<script src="@ViewBag.ContextPath/plugin/ueditor1_2_6_1-utf8-jsp/ueditor.all.min.js" type="text/javascript" charset="utf-8"></script>

<!-- 引入jQuery -->
@{
    string User_Agent = Request.Headers["User-Agent"];
    if (User_Agent.IndexOf("MSIE", StringComparison.OrdinalIgnoreCase) > -1
    && User_Agent.IndexOf("MSIE 6", StringComparison.OrdinalIgnoreCase) > -1
    && User_Agent.IndexOf("MSIE 7", StringComparison.OrdinalIgnoreCase) > -1
    && User_Agent.IndexOf("MSIE 8", StringComparison.OrdinalIgnoreCase) > -1)
    {
        <script src="@ViewBag.ContextPath/jquery-1.10.2.min.js" type="text/javascript" charset="utf-8"></script>
    }
    else
    {
        <script src="@ViewBag.ContextPath/jquery-2.0.3.js" type="text/javascript" charset="utf-8"></script>
    }
}
<!-- 引入jquery扩展 -->
<script src="@ViewBag.ContextPath/syExtJquery.js?version=@version" type="text/javascript" charset="utf-8"></script>

<!-- 引入Highcharts -->
<script src="@ViewBag.ContextPath/Highcharts-3.0.6/js/highcharts.js" type="text/javascript" charset="utf-8"></script>
<script src="@ViewBag.ContextPath/Highcharts-3.0.6/js/modules/exporting.js" type="text/javascript" charset="utf-8"></script>
<!-- 引入Highcharts扩展 -->
<script src="@ViewBag.ContextPath/syExtHighcharts.js?version=@version" type="text/javascript" charset="utf-8"></script>

<!-- 引入EasyUI -->
<link id="easyuiTheme" rel="stylesheet" href="@ViewBag.ContextPath/jquery-easyui-1.3.4/themes/@ViewBag.easyuiTheme/easyui.css" type="text/css">
<link rel="stylesheet" href="@ViewBag.ContextPath/jquery-easyui-1.3.4/themes/icon.css" type="text/css"> 
<script type="text/javascript" src="@ViewBag.ContextPath/jquery-easyui-1.3.4/jquery.easyui.min1.3.6.js" charset="utf-8"></script>
<script type="text/javascript" src="@ViewBag.ContextPath/jquery-easyui-1.3.4/locale/easyui-lang-zh_CN.js" charset="utf-8"></script>

<!-- 引入EasyUI Portal插件 -->
<link rel="stylesheet" href="@ViewBag.ContextPath/jquery-easyui-portal/portal.css" type="text/css">
<script type="text/javascript" src="@ViewBag.ContextPath/jquery-easyui-portal/jquery.portal.js" charset="utf-8"></script>

<!-- 引入easyui扩展 -->
<script src="@ViewBag.ContextPath/syExtEasyUI.js?version=@version" type="text/javascript" charset="utf-8"></script>
<!-- 引入扩展图标 -->
<link rel="stylesheet" href="@ViewBag.ContextPath/style/syExtIcon.css?version=@version" type="text/css">
<!-- 引入自定义样式 -->
<link rel="stylesheet" href="@ViewBag.ContextPath/style/syExtCss.css?version=@version" type="text/css">
<!-- 引入javascript扩展 -->
<script src="@ViewBag.ContextPath/syExtJavascript.js?version=@version" type="text/javascript" charset="utf-8"></script>


<!-- 引入jeasyui-extensions扩展 -->
<script src="@ViewBag.ContextPath/jeasyui-extensions/jquery.jdirk.js?version=@version" type="text/javascript" charset="utf-8"></script>
<link rel="stylesheet" href="@ViewBag.ContextPath/jeasyui-extensions/jeasyui.extensions.css?version=@version" type="text/css">
<script src="@ViewBag.ContextPath/jeasyui-extensions/jeasyui.extensions.js?version=@version" type="text/javascript" charset="utf-8"></script>
<script src="@ViewBag.ContextPath/jeasyui-extensions/jeasyui.extensions.menu.js?version=@version" type="text/javascript" charset="utf-8"></script>
<script src="@ViewBag.ContextPath/jeasyui-extensions/jeasyui.extensions.datagrid.js?version=@version" type="text/javascript" charset="utf-8"></script>
<link rel="stylesheet" href="@ViewBag.ContextPath/jeasyui-extensions/icons/icon-all.css?version=@version" type="text/css">


<!-- 引入自己写的公共js和css -->
<script src="@ViewBag.ContextPath/easymvc.js?version=@version" type="text/javascript" charset="utf-8"></script>
<link rel="stylesheet" href="@ViewBag.ContextPath/themes/main.css?version=@version" type="text/css">
<script src="@ViewBag.ContextPath/plugin/ckeditor/ckeditor.js?version=@version" type="text/javascript" charset="utf-8"></script>
<script src="@ViewBag.ContextPath/plugin/ckeditor/adapters/jquery.js?version=@version" type="text/javascript" charset="utf-8"></script>


<script type="text/javascript">
    function addTab(title, iconCls, url) {

        var tabsCol = $('#mainTabs');
        var opts = {
            title: title,
            closable: true,
            iconCls: iconCls,
            bodyCls: 'panel-noscroll',
            content: sy.formatString('<iframe class="panel-iframe" src="{0}" allowTransparency="true" width="100%" height="99%" frameBorder="0" scrolling="auto" marginheight="0px" marginwidth="0px"></iframe>', url),
            border: true,
            fit: true
        };
        if (tabsCol.tabs('exists', opts.title)) {
            tabsCol.tabs('select', opts.title);
        } else {
            tabsCol.tabs('add', opts);
        }
    }
    function closeTab() {
        var tabsCol = $('#mainTabs');
        var index = tabsCol.tabs('getTabIndex', tabsCol.tabs('getSelected'));
        var tab = tabsCol.tabs('getTab', index);
        if (tab.panel('options').closable) {
            tabsCol.tabs('close', index);
        }
    }
</script>
